<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>moltk.gui.structure_renderer</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="moltk-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://moltk.rotatingpenguin.com/">MolTK python API v0.4.2 Documentation</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="moltk-module.html">Package&nbsp;moltk</a> ::
        <a href="moltk.gui-module.html">Package&nbsp;gui</a> ::
        Module&nbsp;structure_renderer
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="moltk.gui.structure_renderer-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="moltk.gui.structure_renderer-module.html">Module moltk.gui.structure_renderer</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#    MolTK is a Python and C++ toolkit for protein sequence/structure alignment and visualization</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment">#    Copyright (C) 2011  Christopher M. Bruns</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment">#    This program is free software; you can redistribute it and/or modify</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment">#    it under the terms of the GNU General Public License as published by</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment">#    the Free Software Foundation; either version 2 of the License, or</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment">#    (at your option) any later version.</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment">#    This program is distributed in the hope that it will be useful,</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment">#    but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment">#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment">#    GNU General Public License for more details.</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment">#    You should have received a copy of the GNU General Public License along</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment">#    with this program; if not, write to the Free Software Foundation, Inc.,</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment">#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-comment">#   </tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-comment">#    Commercial users should ask about our dual licensing model.</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-comment">#    For questions contact: cmbruns@rotatingpenguin.com</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-comment"># Do not import anything from PySide.QtGui in this file,</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-comment"># to help avoid mixing QtGui thread with OpenGL thread.</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">__future__</tt> <tt class="py-keyword">import</tt> <tt class="py-name">division</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package moltk=moltk-module.html"><a title="moltk" class="py-name" href="#" onclick="return doclink('link-0', 'moltk', 'link-0');">moltk</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class moltk.Rotation3D=moltk.Rotation3D-class.html"><a title="moltk.Rotation3D" class="py-name" href="#" onclick="return doclink('link-1', 'Rotation3D', 'link-1');">Rotation3D</a></tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">PySide</tt> <tt class="py-keyword">import</tt> <tt class="py-name">QtCore</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">PySide</tt><tt class="py-op">.</tt><tt class="py-name">QtCore</tt> <tt class="py-keyword">import</tt> <tt class="py-name">QObject</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">OpenGL</tt><tt class="py-op">.</tt><tt class="py-name">GL</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">OpenGL</tt><tt class="py-op">.</tt><tt class="py-name">GLU</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"> </tt>
<a name="StructureRenderer"></a><div id="StructureRenderer-def"><a name="L30"></a><tt class="py-lineno"> 30</tt> <a class="py-toggle" href="#" id="StructureRenderer-toggle" onclick="return toggle('StructureRenderer');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html">StructureRenderer</a><tt class="py-op">(</tt><tt class="py-base-class">QObject</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="StructureRenderer-expanded"><a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">    StructureRenderer is a custom renderer class that performs all OpenGL</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-docstring">    operations in a separate thread.</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="StructureRenderer.__init__"></a><div id="StructureRenderer.__init__-def"><a name="L35"></a><tt class="py-lineno"> 35</tt> <a class="py-toggle" href="#" id="StructureRenderer.__init__-toggle" onclick="return toggle('StructureRenderer.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">glwidget</tt><tt class="py-op">,</tt> <tt class="py-param">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.__init__-expanded"><a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">        <tt class="py-name">QObject</tt><tt class="py-op">.</tt><tt id="link-2" class="py-name" targets="Method moltk.Aligner.Scorer.__init__()=moltk.Aligner.Scorer-class.html#__init__,Method moltk.Aligner.__init__()=moltk.Aligner-class.html#__init__,Method moltk.Alignment.Row.__init__()=moltk.Alignment.Row-class.html#__init__,Method moltk.Alignment.__init__()=moltk.Alignment-class.html#__init__,Method moltk.Angle.__init__()=moltk.Angle-class.html#__init__,Method moltk.AngleDimension.__init__()=moltk.AngleDimension-class.html#__init__,Method moltk.BaseBiosequence.BaseResidue.__init__()=moltk.BaseBiosequence.BaseResidue-class.html#__init__,Method moltk.BaseBiosequence.__init__()=moltk.BaseBiosequence-class.html#__init__,Method moltk.Biosequence.__init__()=moltk.Biosequence-class.html#__init__,Method moltk.BiosequenceResidue.__init__()=moltk.BiosequenceResidue-class.html#__init__,Method moltk.BitUnit.__init__()=moltk.BitUnit-class.html#__init__,Method moltk.DPTableILU1.__init__()=moltk.DPTableILU1-class.html#__init__,Method moltk.Displacement.__init__()=moltk.Displacement-class.html#__init__,Method moltk.EString.__init__()=moltk.EString-class.html#__init__,Method moltk.EString.const_iterator.__init__()=moltk.EString.const_iterator-class.html#__init__,Method moltk.Information.__init__()=moltk.Information-class.html#__init__,Method moltk.InformationDimension.__init__()=moltk.InformationDimension-class.html#__init__,Method moltk.Length.__init__()=moltk.Length-class.html#__init__,Method moltk.LengthDimension.__init__()=moltk.LengthDimension-class.html#__init__,Method moltk.NanometerUnit.__init__()=moltk.NanometerUnit-class.html#__init__,Method moltk.PDBStructure.Atom.__init__()=moltk.PDBStructure.Atom-class.html#__init__,Method moltk.PDBStructure.Chain.__init__()=moltk.PDBStructure.Chain-class.html#__init__,Method moltk.PDBStructure.Residue.__init__()=moltk.PDBStructure.Residue-class.html#__init__,Method moltk.PDBStructure.__init__()=moltk.PDBStructure-class.html#__init__,Method moltk.Quaternion.__init__()=moltk.Quaternion-class.html#__init__,Method moltk.RadianUnit.__init__()=moltk.RadianUnit-class.html#__init__,Method moltk.RigidTransform.__init__()=moltk.RigidTransform-class.html#__init__,Method moltk.Rotation3D.Row.__init__()=moltk.Rotation3D.Row-class.html#__init__,Method moltk.Rotation3D.__init__()=moltk.Rotation3D-class.html#__init__,Method moltk.TableType.__init__()=moltk.TableType-class.html#__init__,Method moltk.UnitVector3D.__init__()=moltk.UnitVector3D-class.html#__init__,Method moltk.Vector3D.__init__()=moltk.Vector3D-class.html#__init__,Method moltk.gui.moltk_app.MoltkApp.__init__()=moltk.gui.moltk_app.MoltkApp-class.html#__init__,Method moltk.gui.moltk_app.MoltkMainWindow.__init__()=moltk.gui.moltk_app.MoltkMainWindow-class.html#__init__,Method moltk.gui.structure_canvas.StructureCanvas.__init__()=moltk.gui.structure_canvas.StructureCanvas-class.html#__init__,Method moltk.gui.structure_renderer.StructureRenderer.__init__()=moltk.gui.structure_renderer.StructureRenderer-class.html#__init__,Method moltk.std_vector_QueryPositionI1.__init__()=moltk.std_vector_QueryPositionI1-class.html#__init__,Method moltk.std_vector_TargetPositionI1.__init__()=moltk.std_vector_TargetPositionI1-class.html#__init__,Method moltk.std_vector_int.__init__()=moltk.std_vector_int-class.html#__init__"><a title="moltk.Aligner.Scorer.__init__
moltk.Aligner.__init__
moltk.Alignment.Row.__init__
moltk.Alignment.__init__
moltk.Angle.__init__
moltk.AngleDimension.__init__
moltk.BaseBiosequence.BaseResidue.__init__
moltk.BaseBiosequence.__init__
moltk.Biosequence.__init__
moltk.BiosequenceResidue.__init__
moltk.BitUnit.__init__
moltk.DPTableILU1.__init__
moltk.Displacement.__init__
moltk.EString.__init__
moltk.EString.const_iterator.__init__
moltk.Information.__init__
moltk.InformationDimension.__init__
moltk.Length.__init__
moltk.LengthDimension.__init__
moltk.NanometerUnit.__init__
moltk.PDBStructure.Atom.__init__
moltk.PDBStructure.Chain.__init__
moltk.PDBStructure.Residue.__init__
moltk.PDBStructure.__init__
moltk.Quaternion.__init__
moltk.RadianUnit.__init__
moltk.RigidTransform.__init__
moltk.Rotation3D.Row.__init__
moltk.Rotation3D.__init__
moltk.TableType.__init__
moltk.UnitVector3D.__init__
moltk.Vector3D.__init__
moltk.gui.moltk_app.MoltkApp.__init__
moltk.gui.moltk_app.MoltkMainWindow.__init__
moltk.gui.structure_canvas.StructureCanvas.__init__
moltk.gui.structure_renderer.StructureRenderer.__init__
moltk.std_vector_QueryPositionI1.__init__
moltk.std_vector_TargetPositionI1.__init__
moltk.std_vector_int.__init__" class="py-name" href="#" onclick="return doclink('link-2', '__init__', 'link-2');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">parent</tt><tt class="py-op">)</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt> <tt class="py-op">=</tt> <tt class="py-name">glwidget</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Variable moltk.gui.structure_canvas.StructureCanvas.paintCalled=moltk.gui.structure_canvas.StructureCanvas-class.html#paintCalled"><a title="moltk.gui.structure_canvas.StructureCanvas.paintCalled" class="py-name" href="#" onclick="return doclink('link-3', 'paintCalled', 'link-3');">paintCalled</a></tt><tt class="py-op">.</tt><tt class="py-name">connect</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.onPaintCalled()=moltk.gui.structure_renderer.StructureRenderer-class.html#onPaintCalled"><a title="moltk.gui.structure_renderer.StructureRenderer.onPaintCalled" class="py-name" href="#" onclick="return doclink('link-4', 'onPaintCalled', 'link-4');">onPaintCalled</a></tt><tt class="py-op">)</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Variable moltk.gui.structure_canvas.StructureCanvas.resizeCalled=moltk.gui.structure_canvas.StructureCanvas-class.html#resizeCalled"><a title="moltk.gui.structure_canvas.StructureCanvas.resizeCalled" class="py-name" href="#" onclick="return doclink('link-5', 'resizeCalled', 'link-5');">resizeCalled</a></tt><tt class="py-op">.</tt><tt class="py-name">connect</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.onResizeCalled()=moltk.gui.structure_renderer.StructureRenderer-class.html#onResizeCalled"><a title="moltk.gui.structure_renderer.StructureRenderer.onResizeCalled" class="py-name" href="#" onclick="return doclink('link-6', 'onResizeCalled', 'link-6');">onResizeCalled</a></tt><tt class="py-op">)</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">xRot</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">yRot</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">zRot</tt> <tt class="py-op">=</tt> <tt class="py-number">0.0</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">initGLCalled</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
</div><a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"> </tt>
<a name="StructureRenderer.onRotationChanged"></a><div id="StructureRenderer.onRotationChanged-def"><a name="L43"></a><tt class="py-lineno"> 43</tt> <a class="py-toggle" href="#" id="StructureRenderer.onRotationChanged-toggle" onclick="return toggle('StructureRenderer.onRotationChanged');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#onRotationChanged">onRotationChanged</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">glwidget</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.onRotationChanged-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.onRotationChanged-expanded"><a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">        <tt class="py-comment"># print self</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">        <tt class="py-comment"># print glwidget.rotation</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">glwidget</tt><tt class="py-op">:</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">            <tt class="py-name">angles</tt> <tt class="py-op">=</tt> <tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">rotation</tt><tt class="py-op">.</tt><tt class="py-name">convertToBodyFixedXYZAngles</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">xRot</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">yRot</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">zRot</tt><tt class="py-op">)</tt> <tt class="py-op">=</tt> <tt class="py-name">angles</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">            <tt class="py-comment"># print (self.xRot, self.yRot, self.zRot)</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.update()=moltk.gui.structure_renderer.StructureRenderer-class.html#update"><a title="moltk.gui.structure_renderer.StructureRenderer.update" class="py-name" href="#" onclick="return doclink('link-7', 'update', 'link-7');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">         </tt>
<a name="StructureRenderer.update"></a><div id="StructureRenderer.update-def"><a name="L52"></a><tt class="py-lineno"> 52</tt> <a class="py-toggle" href="#" id="StructureRenderer.update-toggle" onclick="return toggle('StructureRenderer.update');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#update">update</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.update-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.update-expanded"><a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Variable moltk.gui.structure_renderer.StructureRenderer.sceneChanged=moltk.gui.structure_renderer.StructureRenderer-class.html#sceneChanged"><a title="moltk.gui.structure_renderer.StructureRenderer.sceneChanged" class="py-name" href="#" onclick="return doclink('link-8', 'sceneChanged', 'link-8');">sceneChanged</a></tt><tt class="py-op">.</tt><tt class="py-name">emit</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">         </tt>
<a name="StructureRenderer.initGL"></a><div id="StructureRenderer.initGL-def"><a name="L55"></a><tt class="py-lineno"> 55</tt> <a class="py-toggle" href="#" id="StructureRenderer.initGL-toggle" onclick="return toggle('StructureRenderer.initGL');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#initGL">initGL</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.initGL-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.initGL-expanded"><a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">makeCurrent</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">        <tt class="py-comment">#</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-name">glClearColor</tt><tt class="py-op">(</tt><tt class="py-number">0.3</tt><tt class="py-op">,</tt> <tt class="py-number">0.2</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-name">glEnable</tt><tt class="py-op">(</tt><tt class="py-name">GL_DEPTH_TEST</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-name">glDepthMask</tt><tt class="py-op">(</tt><tt class="py-name">GL_TRUE</tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-name">glEnable</tt><tt class="py-op">(</tt><tt class="py-name">GL_CULL_FACE</tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">        <tt class="py-name">glCullFace</tt><tt class="py-op">(</tt><tt class="py-name">GL_BACK</tt><tt class="py-op">)</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">initGLCalled</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">        <tt class="py-comment">#</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">doneCurrent</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"> </tt>
<a name="StructureRenderer.paintBackground"></a><div id="StructureRenderer.paintBackground-def"><a name="L67"></a><tt class="py-lineno"> 67</tt> <a class="py-toggle" href="#" id="StructureRenderer.paintBackground-toggle" onclick="return toggle('StructureRenderer.paintBackground');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#paintBackground">paintBackground</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.paintBackground-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.paintBackground-expanded"><a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">        <tt class="py-name">glClear</tt><tt class="py-op">(</tt><tt class="py-name">GL_COLOR_BUFFER_BIT</tt> <tt class="py-op">|</tt> <tt class="py-name">GL_DEPTH_BUFFER_BIT</tt><tt class="py-op">)</tt>         </tt>
</div><a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">         </tt>
<a name="StructureRenderer.setupCamera"></a><div id="StructureRenderer.setupCamera-def"><a name="L70"></a><tt class="py-lineno"> 70</tt> <a class="py-toggle" href="#" id="StructureRenderer.setupCamera-toggle" onclick="return toggle('StructureRenderer.setupCamera');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#setupCamera">setupCamera</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.setupCamera-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.setupCamera-expanded"><a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-name">glMatrixMode</tt><tt class="py-op">(</tt><tt class="py-name">GL_PROJECTION</tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">        <tt class="py-name">glLoadIdentity</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-name">gluPerspective</tt><tt class="py-op">(</tt><tt class="py-number">30</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">aspect</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">500</tt><tt class="py-op">)</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">        <tt class="py-name">glMatrixMode</tt><tt class="py-op">(</tt><tt class="py-name">GL_MODELVIEW</tt><tt class="py-op">)</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt class="py-name">glLoadIdentity</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-name">glTranslatef</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-number">5</tt><tt class="py-op">)</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">        <tt class="py-name">glRotatef</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">xRot</tt> <tt class="py-op">*</tt> <tt class="py-number">180.0</tt> <tt class="py-op">/</tt> <tt class="py-number">3.14159</tt><tt class="py-op">,</tt> <tt class="py-number">1.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">        <tt class="py-name">glRotatef</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">yRot</tt> <tt class="py-op">*</tt> <tt class="py-number">180.0</tt> <tt class="py-op">/</tt> <tt class="py-number">3.14159</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">1.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-name">glRotatef</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">zRot</tt> <tt class="py-op">*</tt> <tt class="py-number">180.0</tt> <tt class="py-op">/</tt> <tt class="py-number">3.14159</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">1.0</tt><tt class="py-op">)</tt> </tt>
</div><a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">         </tt>
<a name="StructureRenderer.paintOpaqueGeometry"></a><div id="StructureRenderer.paintOpaqueGeometry-def"><a name="L81"></a><tt class="py-lineno"> 81</tt> <a class="py-toggle" href="#" id="StructureRenderer.paintOpaqueGeometry-toggle" onclick="return toggle('StructureRenderer.paintOpaqueGeometry');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#paintOpaqueGeometry">paintOpaqueGeometry</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.paintOpaqueGeometry-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.paintOpaqueGeometry-expanded"><a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"> </tt>
<a name="StructureRenderer.paintTransparentGeometry"></a><div id="StructureRenderer.paintTransparentGeometry-def"><a name="L84"></a><tt class="py-lineno"> 84</tt> <a class="py-toggle" href="#" id="StructureRenderer.paintTransparentGeometry-toggle" onclick="return toggle('StructureRenderer.paintTransparentGeometry');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#paintTransparentGeometry">paintTransparentGeometry</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.paintTransparentGeometry-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.paintTransparentGeometry-expanded"><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">         </tt>
<a name="StructureRenderer.paint"></a><div id="StructureRenderer.paint-def"><a name="L87"></a><tt class="py-lineno"> 87</tt> <a class="py-toggle" href="#" id="StructureRenderer.paint-toggle" onclick="return toggle('StructureRenderer.paint');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#paint">paint</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.paint-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.paint-expanded"><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.paint_monoscopic()=moltk.gui.structure_renderer.StructureRenderer-class.html#paint_monoscopic"><a title="moltk.gui.structure_renderer.StructureRenderer.paint_monoscopic" class="py-name" href="#" onclick="return doclink('link-9', 'paint_monoscopic', 'link-9');">paint_monoscopic</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">         </tt>
<a name="StructureRenderer.paint_monoscopic"></a><div id="StructureRenderer.paint_monoscopic-def"><a name="L90"></a><tt class="py-lineno"> 90</tt> <a class="py-toggle" href="#" id="StructureRenderer.paint_monoscopic-toggle" onclick="return toggle('StructureRenderer.paint_monoscopic');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#paint_monoscopic">paint_monoscopic</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.paint_monoscopic-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.paint_monoscopic-expanded"><a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt class="py-comment"># TODO - eventual paint order should be</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-comment"># 1 - paint background color or image or world box</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-comment"># 2 - paint opaque geometry</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">        <tt class="py-comment"># 3 - paint transparent geometry in painter order</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">        <tt class="py-comment"># 4 - optionally paint semi-transparent cross hair</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt class="py-comment"># 5 - paint 2D overlays such as scale bar</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">aspect</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">width</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">height</tt><tt class="py-op">)</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">aspect</tt> <tt class="py-op">&lt;=</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">initGLCalled</tt><tt class="py-op">:</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.initGL()=moltk.gui.structure_renderer.StructureRenderer-class.html#initGL"><a title="moltk.gui.structure_renderer.StructureRenderer.initGL" class="py-name" href="#" onclick="return doclink('link-10', 'initGL', 'link-10');">initGL</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.paintBackground()=moltk.gui.structure_renderer.StructureRenderer-class.html#paintBackground"><a title="moltk.gui.structure_renderer.StructureRenderer.paintBackground" class="py-name" href="#" onclick="return doclink('link-11', 'paintBackground', 'link-11');">paintBackground</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-name">glMatrixMode</tt><tt class="py-op">(</tt><tt class="py-name">GL_PROJECTION</tt><tt class="py-op">)</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-name">glPushMatrix</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-name">glMatrixMode</tt><tt class="py-op">(</tt><tt class="py-name">GL_MODELVIEW</tt><tt class="py-op">)</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-name">glPushMatrix</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.setupCamera()=moltk.gui.structure_renderer.StructureRenderer-class.html#setupCamera"><a title="moltk.gui.structure_renderer.StructureRenderer.setupCamera" class="py-name" href="#" onclick="return doclink('link-12', 'setupCamera', 'link-12');">setupCamera</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.paintOpaqueGeometry()=moltk.gui.structure_renderer.StructureRenderer-class.html#paintOpaqueGeometry"><a title="moltk.gui.structure_renderer.StructureRenderer.paintOpaqueGeometry" class="py-name" href="#" onclick="return doclink('link-13', 'paintOpaqueGeometry', 'link-13');">paintOpaqueGeometry</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.paintTransparentGeometry()=moltk.gui.structure_renderer.StructureRenderer-class.html#paintTransparentGeometry"><a title="moltk.gui.structure_renderer.StructureRenderer.paintTransparentGeometry" class="py-name" href="#" onclick="return doclink('link-14', 'paintTransparentGeometry', 'link-14');">paintTransparentGeometry</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-name">glMatrixMode</tt><tt class="py-op">(</tt><tt class="py-name">GL_PROJECTION</tt><tt class="py-op">)</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-name">glPopMatrix</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">        <tt class="py-name">glMatrixMode</tt><tt class="py-op">(</tt><tt class="py-name">GL_MODELVIEW</tt><tt class="py-op">)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">        <tt class="py-name">glPopMatrix</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">swapBuffers</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"> </tt>
<a name="StructureRenderer.onPaintCalled"></a><div id="StructureRenderer.onPaintCalled-def"><a name="L115"></a><tt class="py-lineno">115</tt> <a class="py-toggle" href="#" id="StructureRenderer.onPaintCalled-toggle" onclick="return toggle('StructureRenderer.onPaintCalled');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#onPaintCalled">onPaintCalled</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.onPaintCalled-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.onPaintCalled-expanded"><a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-comment"># assert QThread.currentThread() == glthread</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">        <tt class="py-comment"># assert QThread.currentThread() != guithread</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">makeCurrent</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-comment"># print "paint"</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method moltk.gui.structure_renderer.StructureRenderer.paint()=moltk.gui.structure_renderer.StructureRenderer-class.html#paint"><a title="moltk.gui.structure_renderer.StructureRenderer.paint" class="py-name" href="#" onclick="return doclink('link-15', 'paint', 'link-15');">paint</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">doneCurrent</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"> </tt>
<a name="StructureRenderer.onResizeCalled"></a><div id="StructureRenderer.onResizeCalled-def"><a name="L123"></a><tt class="py-lineno">123</tt> <a class="py-toggle" href="#" id="StructureRenderer.onResizeCalled-toggle" onclick="return toggle('StructureRenderer.onResizeCalled');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="moltk.gui.structure_renderer.StructureRenderer-class.html#onResizeCalled">onResizeCalled</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">w</tt><tt class="py-op">,</tt> <tt class="py-param">h</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="StructureRenderer.onResizeCalled-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="StructureRenderer.onResizeCalled-expanded"><a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">width</tt> <tt class="py-op">=</tt> <tt class="py-name">w</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">height</tt> <tt class="py-op">=</tt> <tt class="py-name">h</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-comment"># assert QThread.currentThread() == glthread</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">        <tt class="py-comment"># assert QThread.currentThread() != guithread</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">makeCurrent</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">        <tt class="py-comment"># print "resize", w, h</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">        <tt class="py-name">glViewport</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">w</tt><tt class="py-op">,</tt> <tt class="py-name">h</tt><tt class="py-op">)</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">        <tt class="py-comment"># a paint event will arrive soon...</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">glwidget</tt><tt class="py-op">.</tt><tt class="py-name">doneCurrent</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">    <tt id="link-16" class="py-name"><a title="moltk.gui.structure_renderer.StructureRenderer.sceneChanged" class="py-name" href="#" onclick="return doclink('link-16', 'sceneChanged', 'link-8');">sceneChanged</a></tt> <tt class="py-op">=</tt> <tt class="py-name">QtCore</tt><tt class="py-op">.</tt><tt class="py-name">Signal</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="moltk-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://moltk.rotatingpenguin.com/">MolTK python API v0.4.2 Documentation</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Nov 09 19:05:03 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
